package com.hanhai.material.scan.entity;

import com.mybatisflex.annotation.*;

import java.io.Serializable;
import java.util.List;

import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;

/**
 *  实体类。
 *
 * @author youchuang
 * @since 2024/05/21 09:41:48
 */
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
@Table(value = "machine",dataSource = "scan")
public class Machine implements Serializable {

    @Id(keyType = KeyType.Auto)
    private Integer id;

    private Integer parentId;

    private String name;

    private String label;

    private String value;
    @RelationOneToMany(selfField = "id",targetField = "parentId")
    private List<Machine> children;

    @RelationOneToOne(selfField = "parentId",targetField = "id")
    private Machine machine;

}
